/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.javatrainning.thupt.b1;

import java.util.Scanner;

/**
 *
 * @author Autumn
 */
public class bai2 {
    public static int a,b;
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        a=sc.nextInt();
        b=sc.nextInt();
        ucln();
                                           }
    public static void ucln(){
        while(a!=b){if(a>b)a=a-b;
                    else   b=b-a;
                    }
        System.out.println("ucln la: " + a);
                              }
}
